<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>CASE</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.opcodes.bw-xor.html">BW_XOR</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.opcodes.cast.html">CAST</a></div>
 <div class="up"><a href="internals2.opcodes.list.html">Opcode Descriptions and Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="internals2.opcodes.case" class="section">
 <h2 class="title">CASE</h2>
 <div class="section" id="internals2.opcodes.case.code">
  <h2 class="title">PHP code</h2>
  <div class="example-contents">
   <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*<br />&nbsp;*&nbsp;Set&nbsp;result&nbsp;to&nbsp;true&nbsp;if&nbsp;value1&nbsp;equals&nbsp;value2.&nbsp;&nbsp;The&nbsp;value2&nbsp;must&nbsp;be&nbsp;a&nbsp;constant&nbsp;value?<br />&nbsp;*&nbsp;opcode&nbsp;number:&nbsp;48<br />&nbsp;*/<br /></span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />switch&nbsp;(</span><span style="color: #0000BB">$i</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;case&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"i=0"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;case&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"i=1"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />&nbsp;&nbsp;&nbsp;case&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"i=2"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

 </div>
 <div class="section" id="internals2.opcodes.case.listing">
  <h2 class="title">PHP opcodes</h2>
  <p class="simpara">Function name: (null)</p>
  <p class="simpara">Compiled variables: !0=$i </p>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>line</th><th>#</th><th>op</th>
      <th>fetch</th><th>ext</th><th>return</th>
      <th>operands</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>6</td><td>0</td>
      <td>ASSIGN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>!0,0</td>
     </tr>

     <tr>
      <td>8</td><td>1</td>
      <td>CASE</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>~1</td>
      <td>!0,0</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>2</td>
      <td>JMPZ</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>~1,-&gt;6</td>
     </tr>

     <tr>
      <td>9</td><td>3</td>
      <td>ECHO</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>&#039;i%3D0&#039;</td>
     </tr>

     <tr>
      <td>10</td><td>4</td>
      <td>BRK</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>1</td>
     </tr>

     <tr>
      <td>11</td><td>5</td>
      <td>JMP</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>-&gt;8</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>6</td>
      <td>CASE</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>~1</td>
      <td>!0,1</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>7</td>
      <td>JMPZ</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>~1,-&gt;11</td>
     </tr>

     <tr>
      <td>12</td><td>8</td>
      <td>ECHO</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>&#039;i%3D1&#039;</td>
     </tr>

     <tr>
      <td>13</td><td>9</td>
      <td>BRK</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>1</td>
     </tr>

     <tr>
      <td>14</td><td>10</td>
      <td>JMP</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>-&gt;13</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>11</td>
      <td>CASE</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>~1</td>
      <td>!0,2</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>12</td>
      <td>JMPZ</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>~1,-&gt;16</td>
     </tr>

     <tr>
      <td>15</td><td>13</td>
      <td>ECHO</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>&#039;i%3D2&#039;</td>
     </tr>

     <tr>
      <td>16</td><td>14</td>
      <td>BRK</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>1</td>
     </tr>

     <tr>
      <td>17</td><td>15</td>
      <td>JMP</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>-&gt;16</td>
     </tr>

     <tr>
      <td>18</td><td>16</td>
      <td>RETURN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>1</td>
     </tr>

    </tbody>
   
  </table>

 </div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.opcodes.bw-xor.html">BW_XOR</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.opcodes.cast.html">CAST</a></div>
 <div class="up"><a href="internals2.opcodes.list.html">Opcode Descriptions and Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
